package cn.echase.ecare.yinfayun.controller.operate;


import cn.echase.common.result.aop.EchaseResponseResult;
import cn.echase.ecare.yinfayun.domain.dto.RemindSettingDto;
import cn.echase.ecare.yinfayun.domain.entity.StaffCertificate;
import cn.echase.ecare.yinfayun.domain.vo.RemindSettingVo;
import cn.echase.ecare.yinfayun.service.IStaffCertificateService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: zhangbei@echase.cn
 * @Title: StaffProtocolController
 * @ProjectName: ecare-soft
 * @Description: 员工证书
 * @Date: 2023/08/28 14:50
 */
@RequestMapping("/staffCertificate")
@RestController
@Slf4j
@EchaseResponseResult
public class StaffCertificateController {

    @Resource
    private IStaffCertificateService staffCertificateService;

    /**
     * 批量添加员工证书信息
     *
     * @param staffCertificateList 员工证书信息列表
     * @return 响应
     */
    @PostMapping("/insertStaffCertificateBatch")
    @Log(title = "批量添加员工证书信息", businessType = BusinessType.INSERT)
    public void insertStaffCertificateBatch(@RequestBody List<StaffCertificate> staffCertificateList) {
        staffCertificateService.insertStaffCerBatch(staffCertificateList);
    }

    /**
     * 更新员工证书信息
     *
     * @param staffCertificate 员工证书信息列表
     * @return 响应
     */
    @PostMapping("/updateStaffCertificate")
    @Log(title = "更新员工附件信息", businessType = BusinessType.UPDATE)
    public int updateStaffCertificate(@RequestBody StaffCertificate staffCertificate) {
        return staffCertificateService.updateStaffCertificate(staffCertificate);
    }


    @PostMapping("/getRemindSetting")
    @Log(title = "查询机构证照提醒设置", businessType = BusinessType.OTHER)
    public RemindSettingVo getRemindSetting() {
        return staffCertificateService.getRemindSetting();
    }


    @PostMapping("/updateRemindSetting")
    @Log(title = "编辑机构证照提醒设置", businessType = BusinessType.UPDATE)
    public boolean updateRemindSetting(@RequestBody RemindSettingDto remindSettingDto) {
        return staffCertificateService.updateRemindSetting(remindSettingDto);
    }
}
